package com.eshop.service.Impl;

import com.eshop.dao.TypeDao;
import com.eshop.pojo.Type;
import com.eshop.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service("TypeService")
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeDao typeDao;

    @Override
    public List<Type> selectAll() {
        return typeDao.selectAll();
    }

    @Override
    public int add(Type type) {
        return typeDao.add(type);
    }

    @Override
    public int update(Type type) {
        return typeDao.update(type);
    }

    @Override
    public int selectByName(String name) {
        return typeDao.selectByName(name);
    }

    @Override
    public Type selectById(int id) {
        return typeDao.selectById(id);
    }

    @Override
    public List<Type> selectByObject(Type type) {
        return typeDao.selectByObject(type);
    }

    @Override
    public int deleteType(int id) {
        return typeDao.deleteType(id);
    }
}
